package com.symria.server.po;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.annotations.Formula;

/**
 * AdAppReport entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "AD_APP_REPORT")
public class AdAppReport implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer id;
	private Integer adId;
	private String adName;
	private String appName;
	private Integer appId;
    private Integer requestCount;
	private Integer showCount;
	private Integer clickCount;
	private Integer actionCount;
	private Double getMoney;
	private Double payMoney;
	private Date createTime;
	private String hour;

	// Constructors
	@Column(name = "HOUR")
	public String getHour() {
		return hour;
	}

	public void setHour(String hour) {
		this.hour = hour;
	}

	/** default constructor */
	public AdAppReport() {
	}

	/** minimal constructor */
	public AdAppReport(Date createTime) {
		this.createTime = createTime;
	}

	/** full constructor */
	public AdAppReport(Integer adId, Integer appId,
			Integer showCount, Integer clickCount, Integer actionCount,
			Double getMoney, Double payMoney, Date createTime) {
		this.adId = adId;
		this.appId = appId;
		this.showCount = showCount;
		this.clickCount = clickCount;
		this.actionCount = actionCount;
		this.getMoney = getMoney;
		this.payMoney = payMoney;
		this.createTime = createTime;
	}

	
	
	
	@Formula("(SELECT ad.AD_NAME FROM AD_CAMPAIGN ad WHERE ad.AD_ID=AD_ID)")
	public String getAdName() {
		return adName;
	}

	public void setAdName(String adName) {
		this.adName = adName;
	}

	@Formula("(SELECT ai.APP_NAME FROM APP_INFO ai WHERE ai.APP_ID=APP_ID)")
	public String getAppName() {
		return appName;
	}

	public void setAppName(String appName) {
		this.appName = appName;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "AD_ID")
	public Integer getAdId() {
		return this.adId;
	}

	public void setAdId(Integer adId) {
		this.adId = adId;
	}


	@Column(name = "APP_ID")
	public Integer getAppId() {
		return this.appId;
	}

	public void setAppId(Integer appId) {
		this.appId = appId;
	}

	@Column(name = "SHOW_COUNT")
	public Integer getShowCount() {
		return this.showCount;
	}

	public void setShowCount(Integer showCount) {
		this.showCount = showCount;
	}

	@Column(name = "CLICK_COUNT")
	public Integer getClickCount() {
		return this.clickCount;
	}

	public void setClickCount(Integer clickCount) {
		this.clickCount = clickCount;
	}

	@Column(name = "ACTION_COUNT")
	public Integer getActionCount() {
		return this.actionCount;
	}

	public void setActionCount(Integer actionCount) {
		this.actionCount = actionCount;
	}

	@Column(name = "GET_MONEY", precision = 16, scale = 4)
	public Double getGetMoney() {
		return this.getMoney;
	}

	public void setGetMoney(Double getMoney) {
		this.getMoney = getMoney;
	}

	@Column(name = "PAY_MONEY", precision = 16, scale = 4)
	public Double getPayMoney() {
		return this.payMoney;
	}

	public void setPayMoney(Double payMoney) {
		this.payMoney = payMoney;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "CREATE_TIME", nullable = false, length = 0)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	@Column(name = "REQUEST_COUNT")
	public Integer getRequestCount() {
		return requestCount;
	}

	public void setRequestCount(Integer requestCount) {
		this.requestCount = requestCount;
	}
}